<template>
  <baseCard title="云主机类型"
            :height="height"
            :contentStyle="{ paddingTop: '0rem'}">
    <div class="template">
      <div class="template-item">
        <div class="over-template-item-right">
          <div class="details-item">
            <label class="label">{{ "虚拟云主机" }}</label>
            <span class="value">
              {{ addThousandsSeparator(overviewData[0]?.virtual_cloud) }}台</span>
          </div>
        </div>
        <!-- <img src="@/pages/cloudResources/icon/xnyzj.png" -->
        <!-- class="imgclass" /> -->
      </div>
      <div class="template-item">
        <div class="over-template-item-right">
          <div class="details-item">
            <label class="label">{{ "物理云主机" }}</label>
            <span class="value">{{ addThousandsSeparator(overviewData[0]?.physical_cloud) }}台</span>
          </div>
        </div>
        <!-- <img src="@/pages/cloudResources/icon/wlyzj.png" class="imgclass" /> -->
      </div>
    </div>
  </baseCard>
</template>

<script setup>
import { computed, ref } from "vue";
import baseCard from "@/components/vpt-cards-1001/index.vue";
import overTemplate from "@/components/vpt-over-template/index.vue";
import { addThousandsSeparator } from "@/utils/formatter.js";
import vptPieView from "@/components/echarts/vpt-pie-rader/index.vue";

const props = defineProps({
  height: { type: String, default: "" },
  overviewData: { type: Array, default: [] },
});

const option = ref([
  { props: "app_sum", name: "应用总数", value: "12" },
  {
    props: "app_num_warning",
    name: "告警应用数",
    valueClass: "is-danger",
    value: "12",
  },
  {
    props: "app_num_info",
    name: "提示应用数",
    valueClass: "is-warn",
    value: "12",
  },
  {
    props: "app_num_normal",
    name: "正常运行应用数",
    valueClass: "is-success",
    value: "12",
  },
]);
</script>

<style lang="less" scoped>
.imgclass {
  // padding: 0.2rem;
  width: 0.4rem;
  height: 0.4rem;
  margin-top: 0.2rem;
  margin-right: 0.2rem;
  display: block;
}
.template {
  display: flex;

  .template-item {
    background: url("../../../../assets/img/theme3/cloud_tem.png");
    display: flex;
    width: 2.51rem;
    height: 0.84rem;
    margin-right: 0.2rem;
    color: #fff;
    font-size: 0.16rem;
    background-size: 100% 100%;
    border-radius: 0.04rem;
    .value {
      margin-top: 0.1rem;
    }
  }
  .template-item-n1 {
    margin-top: 0.22rem;
    width: 2.5rem;
    height: 0.38rem;
    padding: 0.2rem;
    margin-right: 0.16rem;
    color: #fff;
    font-size: 0.18rem;
    background: #2a83dd1a;
    border: 0.01rem solid #0a3268;
    .value {
      margin-top: 0.1rem;
    }
  }
  .template-item-n2 {
    margin-top: 0.22rem;
    background: linear-gradient(to bottom, #e7f09d, hsla(210, 72%, 38%, 0.102));
    width: 1rem;
    height: 0.38rem;
    padding: 0.2rem;
    margin-right: 0.16rem;
    color: #fff;
    font-size: 0.18rem;
    border: 0.01rem solid #0a3268;
    .value {
      margin-top: 0.1rem;
    }
  }
  .template-item-n3 {
    margin-top: 0.22rem;
    background: linear-gradient(to bottom, #f59393, hsla(210, 72%, 38%, 0.102));
    width: 1rem;
    height: 0.38rem;
    padding: 0.2rem;
    margin-right: 0.16rem;
    color: #fff;
    font-size: 0.18rem;
    border: 0.01rem solid #0a3268;
    .value {
      margin-top: 0.1rem;
    }
  }
  .template-item:last-child {
    margin-right: 0;
  }
}
.over-template-item-right {
  flex: 1;
  display: flex;
  // justify-content: space-around;
  // flex-direction:row-reverse;
  // justify-content: end;
  .details-item {
    width: 1rem;
    // max-width: 1.5rem;
    display: flex;
    flex-direction: column;
    padding-right: 0 0.08rem;
    padding: 0.2rem;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    .label {
      color: #4e5969;
      font-size: 0.16rem;
    }
    .value {
      margin-top: 0.08rem;
      color: #1d2129;
      font-size: 0.2rem;
    }
  }
  .details-item:last-child {
    padding-right: 0;
  }
}
</style>
